﻿using System;
using System.Net;
using System.Net.Sockets;
using System.Text;

namespace Program
{
    class Program
    {
        public static ServerSocket socket;
        static void Main(string[] args)
        {
            socket = new ServerSocket();
            socket.Start("127.0.0.1", 8080, 1024);
            while (true)
            {
                string input = Console.ReadLine();
                //关闭所有连接
                if (input == "Quit")
                {
                    socket.Close();
                }
                //发送消息玩家消息
                else if (input.Substring(0, 2) == ":B")
                {
                    if (input.Substring(2) == "1001")
                    {
                        RoleMsg msg = new RoleMsg();
                        msg.roleID = 200;
                        msg.roleData = new RoleData();
                        msg.roleData.name = "逻辑";
                        msg.roleData.atk = 200;
                        msg.roleData.lev = 200;
                        socket.Broadcast(msg);
                    }
                }
            }
        }
    }
}